module.exports = {
  title: ' Pratice UI',
  description: '一个基础的UI框架',
  base: '/website-ui/',
  themeConfig: {
    logo: '/logo.png',
    head: [['link', { rel: 'icon', href: '/logo.png' }]],
    nav: [
      { text: '主页', link: '/' },
      { text: '组件', link: '/quick-start/' },
      { text: '源码地址', link: '/components/button.md/' },
      { text: 'GitHub', link: 'https://github.com/zheng013' }
    ],
    sidebar: [
      '/quick-start/',
      {
        title: '组件',
        children: [
          '/components/icon.md',
          '/components/button.md',
          '/components/toast.md',
          '/components/input.md',
          '/components/collapse.md',
          '/components/popover.md',
          '/components/tabs.md',
          '/components/layout.md',
          '/components/rowCol.md'
        ]
      }
    ]
  },
  plugins: [
    '@babel/plugin-proposal-decorators',
    '@babel/plugin-proposal-class-properties'
  ],
  chainWebpack(config, isServer) {
    // config 是一个 ChainableConfig 的实例
    //配置webpack的实例，添加loader处理
    config.module
      .rule()
      .test(/\.vue$/)
      .use()
      .loader('vue-loader');
    config.module
      .rule()
      .test(/\.tsx?$/)
      .use()
      .loader('ts-loader')
      .options({
        appendTsSuffixTo: [/\.vue$/]
      });
    // config.resolve.alias.set(
    //   "vue",
    //   "../../node_modules/vue/dist/vue.common.js"
    // );
  }
};
